import numpy as np
class Accuracy:
    def __init__(self) -> None:
        pass

    def forward(self,x,label):
        self.accuracy= np.sum([np.argmax(xx)==ll-1 for xx,ll in zip(x,label)])
        self.accuracy=1.0*self.accuracy/x.shape[0]
        return self.accuracy